package db;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;


public class SessionFactoryUtil {

private static SessionFactory sessionFactory;
private static Session session;
private final static Configuration  c = new Configuration();
static {
	try {
	c.configure();
	sessionFactory = c.buildSessionFactory();
	session = sessionFactory.openSession();
} catch (Throwable ex) {
	System.err.println("Initial SessionFactory creation failed." + ex);
	ex.printStackTrace();
}
}

public static SessionFactory getSessionFactory()
{
	return sessionFactory;
}

public static Session getSession()
{
	return session;
}

}